General Info Template Language WCTL Commands WebX/Chat WebX/Pro
Release Notes Standard Templates URL Codes WebX/Multi FastCGI, NSAPI, ISAPI

Visit the Web Crossing Conference to find a wealth of WebX info and a community of WebX experts on the Web!

FastCGI, NSAPI, and ISAPI Interfaces

Table of Contents

Return to Sysop Documentation

Revision History

Overview

Configuring Standard FastCGI

Configuring NSAPI FastCGI

Configuring ISAPI


» Revision History

21AUG97

  • Integrate FastCGI, NSAPI, and ISAPI into one document.

    21AUG97

  • Initial distribution

  • » Overview

    Web Crossing provides alternative interfaces for some platforms and operating systems that offer better performance than the standard CGI interface. These interfaces avoid the overhead required to spawn a separate CGI process (webx-cgi on Unix, webx.exe on WindowsNT) each time a user accesses Web Crossing. The FastCGI interface uses the industry standard FastCGI protocol, while the NSAPI and ISAPI interfaces are designed specifically for Netscape and Microsoft Internet Information servers respectively.


    » FastCGI

    FastCGI is a very efficient means of communicating between a Web server, such as Apache, and a Web application server, such as Web Crossing.

    If your Web server supports FastCGI, you should use it, because it is faster and uses fewer system resources than the standard CGI interface. FastCGI support is available for the Apache, Open Market, NCSA, and Stronghold Web servers. FastCGI can be used with Netscape servers through an NSAPI module that is available from Lundeen & Associates.

    FastCGI must be used when running Web Crossing on a different host than the Web server.

    » Configuring Web Crossing for FastCGI

    Use the standard CGI script to access Web Crossing, log in as sysop, go to the Control Panel's General Settings page, and scroll down to the FastCGI section.

  • Check the Allow FastCGI Connections checkbox.

  • In the Web Crossing FastCGI Port textbox, enter 8879 (or any available port on the machine on which Web Crossing is running).

  • In the Allowed Web Server IP Address textbox, enter 127.0.0.1 if the Web Crossing server is running on the same host as the Web server. If it is running on a different host, enter the IP address of the Web server's host.

    Web Crossing will then be accessible via both FastCGI and the standard CGI script.

    » Configuring Apache for FastCGI

    Apache does not include FastCGI support by default and must be built with the FastCGI module, available from http://www.fastcgi.com/servers/apache/.

    FastCGI is enabled by configuring Apache to map a file on the Web server to the Web Crossing FastCGI service:

  • Create an empty executable file in your Web server CGI directory:
       cd [your CGI dir]
       touch WebX.fcgi
       chmod a+x WebX.fcgi

  • Add the following lines to the Apache srm.conf file:
       # FastCGI connections to Web Crossing
       ExternalAppClass /[absolute path of your CGI dir]/WebX.fcgi -host 127.0.0.1:8879
       <Location /[your CGI dir]/WebX.fcgi>   SetHandler fastcgi-script
       </Location>
    Use a file system path for the ExternalAppClass directive, and a URL path for the Location directive.

    This ExternalAppClass directive maps WebX.fcgi to a Web Crossing server running on the same host as Apache. To map to a Web Crossing server on a different host, give the host's IP address in place of 127.0.0.1. You must use the same port number (8879 here) as that specified on the Web Crossing General Settings page. The Location and SetHandler directives tell Apache to find and use the FastCGI service for requests for WebX.fcgi.

  • Restart your Apache server to activate the new configuration, and test access to Web Crossing via the WebX.fcgi file, for example: http://www.yoursite.com/cgi-bin/WebX.fcgi


    » NSAPI

    The Web Crossing NSAPI to FastCGI interface is a custom Netscape Application Programming Interface program which allows for the use of FastCGI responder type applications with Netscape Web Servers.

    This FastCGI interface connects to a FastCGI compliant application through TCP/IP. It then forwards all of the appropriate server information from a request to the FastCGI application and then correctly formats the response, sending it back to the browser. This NSAPI/FastCGI interface will work with most FastCGI compliant applications

    Once installed, all access to your Web Crossing Server will be exactly as it was except that all access is now being provided by the FastCGI interface.

    NOTE: This NSAPI Service acts also as a "Filter" and will only run for the URL that has the "Script" name specified in the obj.conf file at the end of the URI.

    » Configuring NSAPI FastCGI

    Installation of the FastCGI interface involves four separate steps:

    1. Copying the FastCGI application to the appropriate directory
    2. Editing the configuration files for your particular Netscape Server using a simple text editor
    3. Apply and restart the Netscape server to reflect the changes in the configuration files and to allow loading of the shared program, FastCgi.
    4. Editing the General Settings in the Web Crossing sysop control panel to allow FastCgi access.

    » Windows NT Configuration

    The Windows NT installation consists of a single ".dll" file called "FastCgi.dll" and this help file.

    1. Copy the file "FastCgi.dll" your Netscape Server's bin directory, i.e. "<server root>/bin/httpd/FastCgi.dll". This is typically located in "c:¥netscape¥server¥bin¥httpd¥*".
    2. Modify your server's obj.conf file to reflect the following changes. This file is usually located in the directory "c:¥netscape¥server¥<NameOfYourServer>¥config¥obj.conf".
    3. obj.conf Modifications:

      At the beginning of obj.conf in the Init section, add the following line::
      Init fn=load-modules shlib=FastCGI.dll funcs=fastcgi

      Inside an object in obj.conf add the following to the BEGINNING of the other Service directives:
      Service method=(GET|HEAD|POST) type=* fn=fastcgi IP=xxx.yyy.zzz.www Port=3000 Script=/WebX

      The IP parameter must be the IP address of the machine that is running the Web Crossing Server.
      The Port parameter must be the port number that is set in the Web Crossing Sysop control panel, FastCGI settings.
      The Script parameter is the script that you are currently using to access Web Crossing.
      NOTE: This file MUST exist in the correct place on your server, even if the file is empty, as this bypasses the internal Netscapes checks to see if a file exists prior to executing the Service directives.

    4. Restart your Netscape server to reflect the changes to the obj.conf and to allow the loading of the shared FastCgi.dll program. You might also need to "Apply" the changes through the administration portion of your server.
    5. Edit the General Settings of the Web Crossing sysop control panel to reflect the port that you chose in step 2.

    » Unix Platform NSAPI Installation

    The Unix installation consists of a single ".so" file called "fastcgi.so" and this help file.

    1. Copy the file "fastcgi.so" your Netscape Server's bin directory, i.e. "<server root>/bin/httpd/fastcgi.so". This is typically located in "/netscape/server/bin/httpd/*".
    2. Modify your server's obj.conf file to reflect the following changes. This file is usually located in the directory "¥netscape¥server¥<NameOfYourServer>¥config¥obj.conf".
    3. obj.conf Modifications:

      At the beginning of obj.conf in the Init section, add the following line::
      Init fn=load-modules shlib=fastcgi.so funcs=fastcgi

      Inside an object in obj.conf add the following to the BEGINNING of the other Service directives:
      Service method=(GET|HEAD|POST) type=* fn=fastcgi IP=xxx.yyy.zzz.www Port=3000 Script=/WebX

      The IP parameter must be the IP address of the machine that is running the Web Crossing Server.
      The Port parameter must be the port number that is set in the Web Crossing Sysop control panel, FastCGI settings.
      The Script parameter is the script that you are currently using to access Web Crossing.
      NOTE: This file MUST exist in the correct place on your server, even if the file is empty, as this bypasses the internal Netscapes checks to see if a file exists prior to executing the Service directives.

    4. Restart your Netscape server to reflect the changes to the obj.conf and to allow the loading of the shared FastCgi.so program. You might also need to "Apply" the changes through the administration portion of your server.
    5. Edit the General Settings of the Web Crossing sysop control panel to reflect the port that you chose in step 2.

    » Custom Options

    You may add an optional parameter to the "obj.conf" file to perform some error and timestamp logging to a file by inserting the following parameter: LogRequests=1 to the Service Directive parameters.

    i.e.:
    Service method=(GET|HEAD|POST) type=* fn=fastcgi IP=xxx.yyy.zzz.www Port=3000 Script=/WebX LogRequests=1

    When this parameter is present, errors and timestamps are written to a log file named fastcgi.log.


    »Web Crossing ISAPI Interface

    Web Crossing Internet Information Server (IIS) API Interface is a plug-in module designed exclusively to work with Microsoft's IIS in conjuction with Web Crossing Server. This dynamically loaded library (.dll) provides the interface between the Web Crossing Server and the requests from users through their WWW browers. Initial tests have shown at least a 2X improvement in speed and access of the discussion forums in Web Crossing. It also allows a much larger message to be posted, bypassing the problems in IIS in terms of the length of posted messages.

    The ISAPI version of the script program also acts as a filter for incoming URL requests to your server. This is activated through the NT Registry settings and is designed to allow older saved or cached bookmarks to continue to work without any effort of your users. It takes the old script name and converts it into the new name automatically. You will notice that eventually all of the links in Web Crossing will incorporate the new URL with "webx.dll".

    Installation consists of copying the new file "webx.dll" into the same directory as the previous script file "webx.exe". This effectively replaces the standard method of accessing Web Crossing. Some settings in the NT registry must also be modified to work with Microsoft IIS.

    » Copying WebX.dll to the right location

    The file "webx.dll" that came with this distribution must be copied to the right location in your normal server document directory. If your site URL is something like: http://www.yoursite.com/scripts/webx.exe? then you must copy the file "webx.dll" into the directory specified by your virtual directory "/scripts" on your hard disk. This is probably something like: "c:¥inetsrv¥scripts¥*". This should be the same location as your existing file "webx.exe".

    » Editing NT Registry Settings

    A few changes must be made to the NT registry settings to allow the filter portion of the WebX.dll to work correcly. If you do not require the filter, then you may skip this section and the filter will not be activated.

      Edit NT Registry Settings through Web Crossing Configuration

    1. Run "Web Crossing Configuration" and select the "ISAPI"tab. Note: if you do not see this tab, then you must install the latest version of Web Crossing Configuration.
    2. Edit the "Currently Installed IIS Filters" box to add the FULL path to the "webx.dll" file that was previously installed into your "scripts" directory. Make sure to separate this new path from the others with a comma (,). Don't erase any of the other settings that are already installed.
    3. Edit the "Old Web Crossing Script Name" to match the URL portion of your site which directed users to Web Crossing, usually "/scripts/webx.exe"
    4. Edit the "New Web Crossing Script Name" to match the new URL to your site, usually "/scripts/webx.dll"
    5. Close the Configuration program and move to the next step, Restarting Microsoft IIS.
    6. Edit NT Registry Settings Manually

    1. Run "regedt32.exe" from the command line or from the "Start -> Run" menu. This is usually located in your NT system32 directory.
    2. Open the Registry for the computer on which Web Crossing and your IIS server is running
    3. Open the setting for : System/CurrentControlSet/Services/W3SVC/Parameters
    4. Edit the value "Filter DLLs and edit the list of filters to add the FULL pathname of the location of the "webx.dll" file that was copied in the earlier step. NOTE: All of the installed filters must be separated by a ',' (comma).
    5. Use the "Edit -> Add Key" menu to add a key called "WebX". Leave the "class" box empty.
    6. Open this newly created "WebX" Registry folder
    7. Use the "Edit ->Add Value" menu to add two values called "OldScript" and "NewScript" as the value names and the URL portion of each for the string box. ie. OldScript would be "/scripts/webx.exe" and NewScript would have the value "/scripts/webx.dll"
    8. Verify that these settings are correct and close the Registry Editor.

    » Restart Microsoft IIS

    You must restart Microsoft IIS WWW server so that the settings will be loaded correctly. Use the "Internet Service Manager" or the NT Services Control panel to stop and start the server.


    Return to Sysop Documentation

    © Copyright 1996-98 by Lundeen & Associates. All rights reserved.